﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/MasterPages/SubMaster.Master" AutoEventWireup="true" CodeBehind="AddFile.aspx.cs" Inherits="ArchivingDataWebForms.Pages.Files.AddFile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title id="serverTitle" runat="server">اضافة ملف</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadButtonSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ValidationSummary" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="AdvancedRadGridResults">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="AdvancedRadGridResults" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="iframeDownload" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelCustomfields">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ValidationSummary" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="AdvancedDateTimePickerFrom">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="AdvancedDateTimePickerFrom" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="AdvancedDateTimePickerTo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="AdvancedDateTimePickerTo" UpdatePanelCssClass=""></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    <telerik:RadTabStrip ID="RadTabStrip" runat="server" MultiPageID="RadMultiPage" CausesValidation="false">
        <Tabs>
            <telerik:RadTab id="RadTabAttachments" runat="server" Text="الملحقات" PageViewID="RadPageViewAttachments" selected="true"></telerik:RadTab>
            <telerik:RadTab id="RadTabInformation" runat="server" Text="الحقول الخاصة" PageViewID="RadPageViewIformation" Selected="true"></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="RadPageViewAttachments" runat="server" Selected="true">
            <div style="padding: 10px;">
                <telerikHelper:AdvancedRadGrid ID="AdvancedRadGridResults" runat="server" SkinID="AdvancedRadGridArDefault" CellSpacing="0" GridLines="None" AutoGenerateColumns="False" ShowGroupPanel="True"
                    OnNeedDataSource="AdvancedRadGridResults_NeedDataSource" OnItemCommand="AdvancedRadGridResults_ItemCommand" OnInsertCommand="AdvancedRadGridResults_InsertCommand"
                    OnItemDataBound="AdvancedRadGridResults_ItemDataBound" OnUpdateCommand="AdvancedRadGridResults_UpdateCommand" OnDeleteCommand="AdvancedRadGridResults_DeleteCommand" OnDetailTableDataBind="AdvancedRadGridResults_DetailTableDataBind" OnItemCreated="AdvancedRadGridResults_ItemCreated">
                    <MasterTableView DataKeyNames="Attachment_ID">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Attachment_ID" DataType="System.Int64" UniqueName="Attachment_ID" HeaderText="الرقم" Display="False" ReadOnly="true" AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Attachment_Code" DataType="System.String" UniqueName="Attachment_Code" HeaderText="الترميز" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AttachmentTitle_Ar" DataType="System.String" UniqueName="AttachmentTitle_Ar" HeaderText="العنوان" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AttachmentNote_Ar" DataType="System.String" UniqueName="AttachmentNote_Ar" HeaderText="الملاحظات" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="الترتيب" AllowFiltering="true" AutoPostBackOnFilter="true" ItemStyle-Width="100px">
                                <ItemTemplate>
                                    <asp:Button ID="ButtonUp" Text='^' runat="server" CausesValidation="False" CommandName="ButtonUp" CommandArgument='<%# Eval("Attachment_ID") %>'></asp:Button>
                                    <asp:Button ID="ButtonDown" Text="v" runat="server" CausesValidation="False" CommandName="ButtonDown" CommandArgument='<%# Eval("Attachment_ID") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false">
                                <ItemTemplate>
                                    <a href='<%# "../Attachments/EditAttachmentPhoto.aspx?Attachment_ID=" + Eval("Attachment_ID") %>' target="_blank">
                                        <asp:Image ID="ImageAttachement" runat="server" ImageUrl='<%# ArchivingDataModel.Attachment.getImageUrl(Eval("Attachment_ID")) %>' Width="50px" Height="50px" />
                                    </a>
                                    <asp:Button ID="ButtonDownload" Text='تحميل' runat="server" CommandName='DownlodAttachment' CommandArgument='<%# Eval("Attachment_ID") %>'></asp:Button>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Ocr" DataType="System.String" UniqueName="Ocr" HeaderText="التحليل الضوئي" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" CancelText="الغاء" EditText="تحرير" UpdateText="حفظ">
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="40px" ConfirmDialogType="RadWindow" ConfirmText="هل انت متاكد من عملية الحذف ؟" ConfirmTitle="حذف" Text="حذف">
                            </telerik:GridButtonColumn>
                            <telerik:GridRowIndicatorColumn Resizable="True" Visible="true">
                            </telerik:GridRowIndicatorColumn>
                        </Columns>
                        <EditFormSettings>
                            <FormTemplate>
                                <div style="padding:10px">
                                    <ul class="UlLayout">
                                        <li class="paddingTop normalFlow" style="width:250px;">الترميز</li>
                                        <li class="paddingTop normalFlow paddingRight">المرفق</li>
                                        <li class="clear"></li>
                                        <li class="normalFlow" style="width:250px;">
                                            <telerik:RadTextBox ID="RadTextBoxPCode" runat="server" Text='<%# Bind("Attachment_Code") %>' SkinID="RadTextBoxDefault"></telerik:RadTextBox>
                                        </li>
                                         <li class="normalFlow paddingRight">
                                            <div>
                                                <telerik:RadAsyncUpload ID="RadAsyncUploadAttachment" runat="server" SkinID="RadAsyncUploadDefault" InitialFileInputsCount="1" MaxFileInputsCount="1">
                                                </telerik:RadAsyncUpload>
                                                <telerik:RadProgressArea ID="RadProgressArea1" runat="server" SkinID="RadProgressAreaDefault"></telerik:RadProgressArea>
                                            </div>
                                        </li>
                                        <li class="clear"></li>
                                       <li class="paddingTop">الاسم</li>
                                        <li>
                                            <telerik:RadTextBox ID="RadTextBoxTitle" runat="server" Text='<%# Bind("AttachmentTitle_Ar") %>' SkinID="RadTextBoxLarge"></telerik:RadTextBox>
                                        </li>
                                        <div class="clear"></div>
                                        <li class="paddingTop">الملاحظات</li>
                                        <li>
                                            <telerik:RadTextBox ID="RadTextBoxPNote" runat="server" TextMode="MultiLine" Rows="5" Text='<%# Bind("AttachmentNote_Ar") %>' SkinID="RadTextBoxLarge"></telerik:RadTextBox>
                                        </li>
                                        <li class="paddingTop">
                                            <div>
                                                <asp:Button ID="ButtonUpdate" Text='حفظ' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>
                                                <asp:Button ID="ButtonCancel" Text="الغاء" runat="server" CausesValidation="False" CommandName="Cancel" />
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </FormTemplate>
                        </EditFormSettings>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="Version_ID" Name="AttachmentsVersioning" CommandItemDisplay="Top" AllowMultiColumnSorting="True" NoMasterRecordsText="لايوجد بيانات لعرضها" AllowSorting="True" GridLines="Both" AllowPaging="True" AllowFilteringByColumn="true">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="Attachment_ID" MasterKeyField="Attachment_ID"></telerik:GridRelationFields>
                                </ParentTableRelation>
                                <RowIndicatorColumn Visible="True">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Visible="True">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Version_ID" DataType="System.Int64" UniqueName="Version_ID" HeaderText="الرقم" Display="False" ReadOnly="true"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Version_Date" DataType="System.DateTime" UniqueName="Version_Date" HeaderText="التاريخ" Display="true" ReadOnly="true"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Attachment_ID" DataType="System.Int64" UniqueName="Attachment_ID" Display="False" ReadOnly="true"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Attachment_Code" DataType="System.String" UniqueName="Attachment_Code" HeaderText="الترميز" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="AttachmentTitle_Ar" DataType="System.String" UniqueName="AttachmentTitle_Ar" HeaderText="العنوان" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="AttachmentNote_Ar" DataType="System.String" UniqueName="AttachmentNote_Ar" HeaderText="الملاحظات" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn AllowFiltering="false">
                                        <ItemTemplate>
                                            <asp:Image ID="ImageVersion" runat="server" ImageUrl='<%#ArchivingDataModel.AttachmentsVersioning.getImageUrl(Eval("Version_ID")) %>' Width="50px" Height="50px" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="Ocr" DataType="System.String" UniqueName="Ocr" HeaderText="التحليل الضوئي" Display="true" EditFormColumnIndex="0"  AutoPostBackOnFilter="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridRowIndicatorColumn Resizable="True" Visible="true">
                                    </telerik:GridRowIndicatorColumn>
                                </Columns>
                                <EditFormSettings EditFormType="Template">
                                    <FormTemplate>
                                        <h1>test</h1>
                                    </FormTemplate>
                                </EditFormSettings>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                </telerikHelper:AdvancedRadGrid>
                <iframe id="iframeDownload" src="" runat="server" style="display:none;width:1px; height:1px;"></iframe>
            </div>

        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageViewIformation" runat="server">
            <div style="width: 820px; padding: 10px; border: 1px solid;">
                <ul class="UlLayout normalFlow" style="display:none;">
                    <li>الترميز</li>
                    <li>
                        <telerik:RadTextBox ID="RadTextBoxCode" runat="server" SkinID="RadTextBoxDefault"></telerik:RadTextBox>
                    </li>
                </ul>
                <ul class="UlLayoutWithMarginRight normalFlow" style="display:none;">
                    <li>من</li>
                    <li>
                        <telerikHelper:AdvancedDateTimePicker ID="AdvancedDateTimePickerFrom" runat="server" SkinID="AdvancedDateTimePickerDefault"></telerikHelper:AdvancedDateTimePicker>
                    </li>
                </ul>
                <ul class="UlLayoutWithMarginRight normalFlow" style="display:none;">
                    <li>الى</li>
                    <li>
                        <telerikHelper:AdvancedDateTimePicker ID="AdvancedDateTimePickerTo" runat="server" SkinID="AdvancedDateTimePickerDefault"></telerikHelper:AdvancedDateTimePicker>
                    </li>
                </ul>
                <div class="clear"></div>
                <ul class="UlLayout">
                    <li style="display: none;">
                        <ul class="UlLayout">
                            <li class="paddingTop">العنوان</li>
                            <li class="normalFlow">
                                <telerik:RadTextBox ID="RadTextBoxTitle" runat="server" SkinID="RadTextBoxLarge"></telerik:RadTextBox>
                            </li>
                            <li class="normalFlow">
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ControlToValidate="RadTextBoxTitle" ErrorMessage="من فضلك ادخل عنوان الملف" SkinID="RequiredFieldValidatorDefault"></asp:RequiredFieldValidator>
                            </li>
                            <li class="clear"></li>
                            <li class="paddingTop">الموضوع</li>
                            <li>
                                <telerik:RadTextBox ID="RadTextBoxSubject" runat="server" TextMode="MultiLine" Rows="5" SkinID="RadTextBoxLarge"></telerik:RadTextBox>
                            </li>
                            <li class="paddingTop">الملاحظات</li>
                            <li>
                                <telerik:RadTextBox ID="RadTextBoxNote" runat="server" TextMode="MultiLine" Rows="5" SkinID="RadTextBoxLarge"></telerik:RadTextBox>
                            </li>
                            <li class="paddingTop">
                                <telerik:RadButton ID="RadButtonRecycleBin" runat="server" Text="سلة المحذوفات" ButtonType="ToggleButton" ToggleType="CheckBox"></telerik:RadButton>
                            </li>
                            <li class="paddingTop" style="border-bottom: 1px solid;"></li>
                        </ul>
                    </li>
                    <li>
                        <asp:Panel ID="PanelCustomfields" runat="server">
                        </asp:Panel>
                    </li>
                    <li class="paddingTop">
                        <asp:ValidationSummary ID="ValidationSummary" runat="server" SkinID="ValidationSummaryDefault" />
                    </li>
                    <li style="text-align: center;" class="paddingTop">
                        <telerik:RadButton ID="RadButtonSave" runat="server" Text="حفظ" OnClick="RadButtonSave_Click"></telerik:RadButton>
                    </li>
                </ul>
            </div>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
</asp:Content>
